<template>
    <app-layout>
        <section class="content-header">
            <h1>
                App 设置
                <small></small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a href="#">大转盘</a></li>
                <li class="active">批量核销</li>
            </ol>
        </section>

    <section class="content">
        <!-- Default box -->
        <div class="box box-primary">

            <div class="box-header with-border">
                <h3 class="box-title">批量核销</h3>
            </div>

            <div class="box-body">
                <el-form ref="form" :model="form" label-width="100px">
                 
                    <el-form-item label="中奖序列号">
                        <el-input type="textarea" v-model="form.volume_numbers" placeholder="每行一个，回车换行..." rows="20" cols="20"></el-input>
                    </el-form-item>
            
                    <el-form-item>
                        <el-button type="primary" @click="onSubmit">立即核销</el-button>
                        <el-button @click="$router.go(-1)">取消</el-button>
                    </el-form-item>                    
                    
                </el-form>
            </div>
        </div>
        <!-- /.box -->
    </section>        

    </app-layout>
</template>

<script>
import * as API from "../../Consts/Api";
import * as APP from "@/constants/app";
import Layout from "@/components/Layout";

export default {
    components: {
        "app-layout": Layout
    },  

    data() {
      return {
        API,      
        form: {
            volume_numbers: '',
        }
      }
    },

    created: function() {

    },

    methods: {
        onSubmit() {
            this.$http.put(API.RECORDS_CHECK, this.form).then(response => {
                if (response.data.status == "no") {
                    this.$message({
                        message: response.data.message,
                        type: "error",
                        duration: 5000
                    });
                } else {
                    this.$message({
                        message: response.data.message,
                        type: "success",
                        duration: 5000
                    });                    
                }
            });
        },
    },
};
</script>